﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LawProject.Models;
using Repository.Repositories;
using Repository.Entities;
using Repository.Contracts;
using Core.Interfaces;
using System.IO;

namespace LawProject.Controllers
{
    public class BanTinController : Controller
    {
        private IRepository<TBLinhVuc> linhvucRepository;
        private IRepository<TBBanTin> bantinRepository;
        private IRepository<TBBanTinCon> bantinconRepository;
        private IRepository<TBHoTro> hotroRepository;

        public BanTinController()
            : this(IoC.Resolve<IRepository<TBLinhVuc>>(), IoC.Resolve<IRepository<TBBanTin>>(), IoC.Resolve<IRepository<TBBanTinCon>>(), IoC.Resolve<IRepository<TBHoTro>>())
        {
        }

        public BanTinController(IRepository<TBLinhVuc> linhvucRepository, IRepository<TBBanTin> bantinRepository, IRepository<TBBanTinCon> bantinconRepository, IRepository<TBHoTro> hotroRepository)
        {
            this.linhvucRepository = linhvucRepository;
            this.bantinconRepository = bantinconRepository;
            this.bantinRepository = bantinRepository;
            this.hotroRepository = hotroRepository;
        }

        //[Authorize]
        public ActionResult Create(string MaTB)
        {
            BanTinConClass btc = new BanTinConClass();
            btc.MaBanTin = "xxx";
            return View(btc);
        }

        [HttpPost]
        [ValidateInput(false)]
        public ActionResult Create(BanTinConClass banTinCon)
        {
            return View();
        }

        [Authorize]
        [ValidateInput(false)]
        public ActionResult Edit(string MaTBC)
        {
            return View(new BanTinConClass());
        }

        [HttpPost]
        [Authorize]
        public ActionResult Edit(string MaTB, BanTinConClass banTinCon)
        {
            return View();
        }



    }
}
